<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Diwali Background</title>
  <link rel="stylesheet" href="style.css">
</head>

<body>
  <section class="sec"></section>
</body>
<script>
  for (let i = 1; i <= 300; i++) {
    let box = document.createElement('div')
    box.classList.add('box')
    document.querySelector('.sec').appendChild(box)
  }

  function animatebox() {
    let boxes = document.querySelectorAll('.box')
    let num = Math.floor(Math.random() * boxes.length)
    boxes[num].classList.toggle('animate')
  }
</script>

</html>